# encoding=utf8
import time
from math import ceil

import requests
import re
import json
import os
import shutil
from contextlib import closing
from tqdm import tqdm
from Bilibili下载器_ffmpeg版本_队列 import bilibili, Downloader
import sys

debug = False


def logError(url):
    with open('错误队列.txt', 'a') as f:
        f.write(url + '\n')


def main():
    # url = input('url:')
    url = sys.argv[1]
    ffmpegPath = r'ffmpeg.exe'
    a = bilibili(url, ffmpegPath)
    if not a.main():
        logError(url)
        print('记录日志完成')


if __name__ == '__main__':
    main()
